package com.itheima.service;

import com.itheima.dao.UserDao;
import com.itheima.pojo.User;
import com.itheima.utils.MybatisUtils;
import org.apache.ibatis.session.SqlSession;

import java.io.IOException;

/**
 * @author slstart
 * @create 2021-05-23 18:56
 */
public class UserService {
    public User login(User u) throws IOException {
        SqlSession sqlSession = MybatisUtils.getSqlSession();
        UserDao mapper = sqlSession.getMapper(UserDao.class);
        User user = mapper.login(u);
        sqlSession.close();
        return user;
    }
}
